package com.springboot.repository;

import com.springboot.domain.BtComment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CommentRepository extends JpaRepository<BtComment,String>{

    @Query("select max(bc.floor) from BtComment bc where bc.demandId = ?1")
    Integer findMaxFloorByDemand(String demandId);

    List<BtComment> findByDemandIdOrderByFloor(String demandId);
}
